package com.google.code.irouter.portal.client.rpc.consumer;

import java.util.List;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("ConsumerService")
public interface ConsumerService extends RemoteService {
	/**
	 * Utility class for simplifying access to the instance of async service.
	 */
	public static class Util {
		private static ConsumerServiceAsync instance;
		public static ConsumerServiceAsync getInstance(){
			if (instance == null) {
				instance = GWT.create(ConsumerService.class);
			}
			return instance;
		}
	}
	
	List<ConsumerResult> load(String tags) throws IllegalArgumentException;
	ConsumerResult get(String id) throws IllegalArgumentException;
	
	boolean save(String id, String name, String sender, String consumerKey, String consumerSecret, String user, String password, int maxLength, int quota, String tags) throws IllegalArgumentException;
	boolean remove(String[] ids) throws IllegalArgumentException;
}
